01.2 Polar Coordinate System

A polar coordinate system is a 2-D coordinate system defined by two unit vectors:

  1. $\hat{r}$ which points radially outward from the origin,
  2. $\hat{\phi}$ which is tangent to a circle, typically in the counterclockwise direction.

The position of a particle in a polar coordinate system is

$$\vec{r}=r\hat{r}$$

If you know the position of a particle in polar coordinates, you can convert to Cartesian coordinates using

$$x=r\mathrm{cos}\phi$$$$y=r\mathrm{sin}\phi.$$

When we write the position of a particle as

$$\vec{r}=r\hat{r}$$

the vector $\vec{r}$ actually contains information about both $r$ and $\phi$. That's because the direction $\hat{r}$ depends on $\phi$. In Cartesian coordinates, $\hat{r}$ is

$$\hat{r}=<\mathrm{cos}\phi, \mathrm{sin}\phi>=\mathrm{cos}\phi\hat{x} + \mathrm{sin}\phi\hat{y}.$$

So in Cartesian coordinates, the vector $\vec{r}$ is

$$\vec{r}=r\hat{r}=<r\mathrm{cos}\phi, r\mathrm{sin}\phi>=r\mathrm{cos}\phi\hat{x} + r\mathrm{sin}\phi\hat{y}.$$

The unit vector $\hat{\phi}$ is perpendicular to $\hat{r}$. So its components are

$$\hat{\phi}=<-\mathrm{sin}\phi, \mathrm{cos}\phi>$$

Displaying polar unit vectors in iVisual

Import the necessary packages.


In [1]:
from __future__ import division, print_function
from ivisual import *
from math import *


Suppose that we have a vector of length 4 m and angle 30$^\circ$ from the x axis. Let's draw the vector and the unit vectors $\hat{r}$ and $\hat{\phi}$ in iVisual.


In [13]:
scene = canvas(title='Polar Coordinate System')

#draw x, y, z axes
L=12 #length of axes
sw=L/100 #shiftwidth of axes
xaxis=arrow(pos=(-L/2,0,0), axis=(L,0,0), shaftwidth=sw)
yaxis=arrow(pos=(0,-L/2,0), axis=(0,L,0), shaftwidth=sw)
#zaxis=arrow(pos=(0,0,-L/2), axis=(0,0,L), shaftwidth=sw)

#define r and phi
r=4
phi=30

#convert to cartesian coordinates in order to draw in iVisual
#You have to convert the angle from degrees to radians
r_cart_coord=vector(r*cos(phi*pi/180), r*sin(phi*pi/180),0)

#r unit vector
rhat=vector(cos(phi*pi/180), sin(phi*pi/180),0)

#phi unit vector
phihat=vector(-sin(phi*pi/180),cos(phi*pi/180),0)

#draw arrows
sw=r/25 #shaftwidth for arrows
rarrow=arrow(pos=(0,0,0), axis=r_cart_coord, shaftwidth=sw, color=color.orange)
rhatarrow=arrow(pos=r_cart_coord, axis=rhat, shaftwidth=sw, color=color.blue)
phihatarrow=arrow(pos=r_cart_coord, axis=phihat, shaftwidth=sw, color=color.green)


Example

Now suppose that the particle moves from this position ($r=4$ m, $30^\circ$) to a new position ($r=6$ m, $60^\circ$) in a time of $\Delta t=1$ s. What is the average velocity of the particle in polar coordinates?

We can answer the question analytically, and we can sketch the vectors in order to visualize it. Let's first sketch the vectors and then solve the problem analytically.

First, run the code below to draw the new vector.


In [14]:
#define r and phi
r2=6
phi2=60

#convert to cartesian coordinates in order to draw in iVisual
#You have to convert the angle from degrees to radians
r_cart_coord2=vector(r2*cos(phi2*pi/180), r2*sin(phi2*pi/180),0)

#r unit vector
rhat2=vector(cos(phi2*pi/180), sin(phi2*pi/180),0)

#phi unit vector
phihat2=vector(-sin(phi2*pi/180),cos(phi2*pi/180),0)

#draw arrows
rarrow2=arrow(pos=(0,0,0), axis=r_cart_coord2, shaftwidth=sw, color=color.red)
rhatarrow2=arrow(pos=r_cart_coord2, axis=rhat2, shaftwidth=sw, color=color.blue)
phihatarrow2=arrow(pos=r_cart_coord2, axis=phihat2, shaftwidth=sw, color=color.green)

Note that the displacement $\Delta \vec{r}$ of the particle results in a corresponding change in the unit vectors $\hat{r}$ and $\hat{\phi}$ because their directions changed as well. This does not happen in Cartesian coordinates because $\hat{x}$ and $\hat{y}$ for example stay fixed when $\vec{r}$ changes.

The displacement vector during a small time interval is

$$\Delta\vec{r}=\Delta r \hat{r} + r\Delta\phi \hat{\phi}$$

You will notice that it has two components. The $\hat{r}$ component depends on the change in the magnitude of $r$. The $\hat{\phi}$ depends on the change in teh angle $\phi$ for a (nearly) constant $r$. (This for a small time interval so you can use the final $r$, initial $r$, or average $r$ when computing the $\hat{\phi}$ component.)

The intantaneous velocity is

$$\dot{\vec{r}}=\dot{r} \hat{r} + r\dot{\phi}\hat{\phi}$$

Let's now show the displacement vector for our example. Note that it is approximate because for visualization purposes I chose a large displacement. I will use the average $r$ when computing the $\hat{\phi}$ component. Furthermore, I will use the unit vectors for the second position vector, $\hat{r}_2$ and $\hat{\phi}_2$.


In [15]:
dr=r2-r #change in r
dphi=phi2*pi/180-phi*pi/180 #change in phi in radians
drvector=dr*rhat2+(r+r2)/2*dphi*phihat2 #displacement vector using average r

#draw displacement vector
drarrow=arrow(pos=r_cart_coord, axis=drvector, shaftwidth=sw, color=color.yellow)

You will notice that it's a little bit off. It should point from the first position vector (orange) to the second position vector (red). The reason it is off is that it is an approximation that is only valid for small displacements (which are presumably during small time intervals).

To see that the approximation improves for a smaller displacement and also works for obvious cases (like linear motion along a radial line), try changing the second position vector and viewing the results. Note that you may have to restart the kernel and run each cell again after changing $\vec{r}_2$.

Try:

$$r_2=4\ \mathrm{m},\ \phi_2=45^\circ$$

and

$$r_2=6\ \mathrm{m},\ \phi_2=30^\circ$$

In [15]:


In [ ]: